import request from "@/utils/request";

/**
 * 经销商列表
 * @param {*} param
 */
export function getDealerList(param) {
  const { pageNum, pageSize, ...data } = param;
  return request({
    url: `/gongyuan/dealer/list?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "post",
    data
  });
}

/**
 * 经销商-根据ID查询
 * @param {*} id
 */
export function getDealerDetail(id) {
  return request({
    url: `gongyuan/dealer/${id}`,
    method: "get"
  });
}

/**
 * 经销商-删除
 * @param {*} id
 */
export function delDealer(id) {
  return request({
    url: `gongyuan/dealer/${id}`,
    method: "delete"
  });
}

/**
 * 经销商-添加
 * @param {*} data
 */
export function addDealer(data) {
  return request({
    url: "/gongyuan/dealer",
    method: "post",
    data
  });
}

/**
 * 经销商-更新
 * @param {*} data
 */
export function updateDealer(data) {
  return request({
    url: "/gongyuan/dealer",
    method: "put",
    data
  });
}
